/* ==========================================================================
   Home (Home) — app-specific styles
   Brand tokens: /platform/shared/styles/tokens.css
   Base reset:   /platform/shared/styles/base.css
   Destination grid, song wall, search chrome. See DEPENDENCIES.md.
   ========================================================================== */

:root {
  --tile-width: 100px;
  --grid-gap: 0.35rem;

  --gap-header: 1rem;
  --gap-main: 0.5rem;
  --destination-pad-block: 0.375rem;

  --home-search-strip-h: 2.85rem;
  --home-inline-pad: clamp(0.85rem, 2.5vw, 2rem);
  --home-content-top: calc(var(--song-wall-height) + var(--home-search-strip-h) + var(--gap-header));
  --start-bottom-reserve: 8.75rem;
  --destination-pad-block: 0.35rem;
  --destination-glow-pad: 1.5rem;
}

body.home-page {
  height: 100vh;
  overflow: hidden;
}

html:has(body.home-page) {
  overflow: hidden;
}

html:has(body.home-page--main-scroll) {
  overflow-y: auto;
  height: auto;
}

/* ==========================================================================
   Background - subtle motion & depth
   ========================================================================== */

.matrix-rain {
  display: none;
}

.ambient-root {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Song wall: platform/shared/styles/song-wall.css */

.home-hero-veil {
  display: none;
}

.home-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 18% 8%, rgba(139, 92, 246, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 55% 40% at 50% 12%, rgba(212, 132, 90, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(0, 0, 0, 0.5) 0%, transparent 70%);
  animation: ambient-pulse 14s ease-in-out infinite;
}

.home-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 40% 30% at 72% 18%, rgba(184, 192, 204, 0.04) 0%, transparent 60%);
  animation: ambient-drift 20s ease-in-out infinite alternate;
}

@keyframes ambient-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.88; }
}

@keyframes ambient-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-2%, 1.5%) scale(1.03); }
}

/* ==========================================================================
   Portal layout
   ========================================================================== */

.home-shell {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  height: 100vh;
  max-height: 100vh;
  margin-inline: auto;
  padding: var(--home-content-top) var(--home-inline-pad)
    calc(var(--start-bottom-reserve) + env(safe-area-inset-bottom, 0px));
  gap: 0;
  overflow: hidden;
  pointer-events: none;
}

.home-shell > * {
  pointer-events: auto;
}

.home__header {
  position: fixed;
  top: var(--song-wall-height);
  left: 0;
  right: 0;
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0.2rem var(--home-inline-pad) 0;
  flex-shrink: 0;
  box-sizing: border-box;
  pointer-events: none;
}

.home__header .search {
  width: 100%;
  max-width: min(36rem, 100%);
  pointer-events: auto;
  background: linear-gradient(
    135deg,
    rgba(212, 132, 90, 0.55) 0%,
    rgba(154, 144, 128, 0.18) 42%,
    rgba(139, 92, 246, 0.28) 100%
  );
  box-shadow:
    0 0 24px rgba(212, 132, 90, 0.12),
    0 0 48px rgba(139, 92, 246, 0.06);
}

/* Portal search — extends search-shared.css */

.home__header .search__input {
  padding-left: 2.875rem;
  color: var(--silver);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.home__header .search__icon {
  left: 16px;
  width: 17px;
  height: 17px;
}

.destination-empty {
  width: 100%;
  max-width: 22rem;
  margin-inline: auto;
}

/* ==========================================================================
   Launcher area
   ========================================================================== */

.destination-wrap {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  padding: var(--gap-main) 0 var(--destination-pad-block);
  margin-inline: 0;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.destination-wrap--search {
  align-items: stretch;
  justify-content: flex-start;
  padding-top: 0.2rem;
  overflow: visible;
}

/* Main page scroll only when many search rows (never inner wrap scroll) */
body.home-page.home-page--main-scroll {
  height: auto;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.home-shell.home-shell--main-scroll {
  height: auto;
  min-height: 100vh;
  max-height: none;
  overflow: visible;
}

.home-shell--search {
  --home-inline-pad: clamp(0.65rem, 1.6vw, 1.15rem);
}

.destination-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, 4), minmax(0, var(--tile-width)));
  justify-items: center;
  align-items: start;
  align-content: center;
  place-content: center;
  gap: var(--grid-gap);
  width: min(100%, var(--grid-content-width, max-content));
  max-width: 100%;
  max-height: 100%;
  margin-inline: auto;
  flex: 0 1 auto;
  min-height: 0;
  overflow: visible;
  padding: 0;
}

/* Full cell is the link; icon + label centered inside */
.destination-grid .destination-tile {
  width: var(--tile-width, 100%);
  max-width: 100%;
  margin: 0;
  padding: 0.35rem;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
}

.destination-grid .destination-tile:hover,
.destination-grid .destination-tile:focus-visible {
  transform: none;
  z-index: 40;
}

.destination-grid .destination-tile:active {
  transform: none;
}

.destination-grid .destination-tile__icon-wrap {
  width: var(--icon-panel, var(--tile-width, 120px));
  max-width: 100%;
  flex-shrink: 0;
}

/* SVG strokes leave hollow centers — keep hit testing on the panel, not paths */
.destination-grid .destination-tile__icon,
.destination-grid .destination-tile__icon svg {
  pointer-events: none;
}

.destination-grid .destination-tile__icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.destination-grid .destination-tile__name {
  max-width: 100%;
  text-align: center;
}

.destination-grid--full-width {
  grid-template-columns: repeat(var(--grid-cols, 4), minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
}

.destination-grid--full-width .destination-tile {
  width: 100%;
  max-width: none;
}

.destination-grid--search {
  width: min(100%, var(--grid-content-width, max-content));
  max-width: 100%;
  align-content: start;
  place-content: start center;
  flex: 0 1 auto;
}

/* Half-grid + motion hints live in platform/shared/styles/fluid-grid.css */

.destination-grid[data-density="filter"],
.destination-grid[data-density="overview"] {
  max-width: 100%;
}

.destination-logo,
.destination-grid--orbit {
  display: none !important;
}

.destination-grid[data-density="pinpoint"] {
  max-width: 880px;
  margin-inline: auto;
}

/* Home portal tile — theme hues + hint overlay (motion in fluid-tiles.css) */

.destination-tile {
  border-radius: var(--radius-lg);
  --tile-hue: var(--accent);
  --tile-hue-soft: rgba(212, 132, 90, 0.34);
  --tile-hue-border: rgba(212, 132, 90, 0.48);
  --tile-hue-glow: rgba(212, 132, 90, 0.55);
  --tile-bg-a: rgba(212, 132, 90, 0.28);
  --tile-bg-b: rgba(139, 92, 246, 0.12);
}

.destination-tile.is-keyboard-focus .destination-tile__icon-wrap {
  border-color: var(--border-accent);
  box-shadow:
    0 0 0 1px rgba(212, 132, 90, 0.14),
    0 6px 28px var(--accent-glow);
}

.destination-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.destination-tile__icon-wrap {
  background: linear-gradient(
    150deg,
    var(--tile-bg-a) 0%,
    var(--tile-bg-b) 38%,
    rgba(12, 18, 32, 0.92) 100%
  );
  border: 1px solid var(--tile-hue-border);
  color: var(--tile-hue);
  margin-bottom: 0.35rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 20px rgba(0, 0, 0, 0.28);
}

.destination-tile__icon-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, var(--tile-hue-soft), transparent 58%);
  opacity: 0.9;
  pointer-events: none;
}

.destination-tile__icon {
  filter: drop-shadow(0 0 10px var(--tile-hue-glow)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.destination-grid .destination-tile:hover .destination-tile__icon-wrap,
.destination-grid .destination-tile:focus-visible .destination-tile__icon-wrap {
  transform: scale(var(--fluid-tile-hover-scale, 1.12));
  border-color: var(--tile-hue);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--tile-hue) 22%, transparent),
    0 8px 32px var(--tile-hue-glow),
    0 14px 44px color-mix(in srgb, var(--tile-hue) 25%, transparent);
}

.destination-grid .destination-tile:hover .destination-tile__icon,
.destination-grid .destination-tile:focus-visible .destination-tile__icon {
  filter: drop-shadow(0 0 14px var(--tile-hue-glow)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
  opacity: 1;
}

.destination-tile:hover .destination-tile__icon-wrap,
.destination-tile:focus-visible .destination-tile__icon-wrap {
  border-color: var(--tile-hue);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--tile-hue) 22%, transparent),
    0 8px 32px var(--tile-hue-glow),
    0 14px 44px color-mix(in srgb, var(--tile-hue) 25%, transparent);
}

.destination-tile:hover .destination-tile__icon,
.destination-tile:focus-visible .destination-tile__icon {
  filter: drop-shadow(0 0 14px var(--tile-hue-glow)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
  opacity: 1;
}

.destination-tile__hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  text-align: center;
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--silver);
  background: rgba(8, 12, 20, 0.94);
  border-radius: inherit;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.26s var(--flow-ease);
}

.destination-tile:hover .destination-tile__hint,
.destination-tile:focus-visible .destination-tile__hint {
  opacity: 1;
  transform: translateY(0);
}

.destination-tile--planned {
  opacity: 0.92;
  cursor: default;
}

.destination-tile__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--silver);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 5px;
  background: rgba(10, 22, 40, 0.85);
}

.destination-tile--primary .destination-tile__icon-wrap {
  border-color: var(--tile-hue);
  box-shadow: 0 0 32px var(--tile-hue-glow);
}

/* Per-tile hues — workshop spectrum (notes, waves, EQ) */
.destination-tile--theme-copper { --tile-hue: #f0b888; --tile-hue-soft: rgba(212, 132, 90, 0.42); --tile-hue-border: rgba(212, 132, 90, 0.58); --tile-hue-glow: rgba(212, 132, 90, 0.72); --tile-bg-a: rgba(212, 132, 90, 0.34); --tile-bg-b: rgba(249, 115, 22, 0.14); }
.destination-tile--theme-violet { --tile-hue: #c4b5fd; --tile-hue-soft: rgba(139, 92, 246, 0.42); --tile-hue-border: rgba(139, 92, 246, 0.58); --tile-hue-glow: rgba(139, 92, 246, 0.72); --tile-bg-a: rgba(139, 92, 246, 0.32); --tile-bg-b: rgba(192, 132, 252, 0.14); }
.destination-tile--theme-magenta { --tile-hue: #f0abfc; --tile-hue-soft: rgba(217, 70, 239, 0.4); --tile-hue-border: rgba(217, 70, 239, 0.55); --tile-hue-glow: rgba(217, 70, 239, 0.68); --tile-bg-a: rgba(217, 70, 239, 0.28); --tile-bg-b: rgba(236, 72, 153, 0.14); }
.destination-tile--theme-cyan { --tile-hue: #7dd3fc; --tile-hue-soft: rgba(34, 211, 238, 0.4); --tile-hue-border: rgba(34, 211, 238, 0.55); --tile-hue-glow: rgba(34, 211, 238, 0.68); --tile-bg-a: rgba(34, 211, 238, 0.26); --tile-bg-b: rgba(96, 165, 250, 0.14); }
.destination-tile--theme-amber { --tile-hue: #fde68a; --tile-hue-soft: rgba(251, 191, 36, 0.42); --tile-hue-border: rgba(251, 191, 36, 0.58); --tile-hue-glow: rgba(251, 191, 36, 0.68); --tile-bg-a: rgba(251, 191, 36, 0.3); --tile-bg-b: rgba(249, 115, 22, 0.12); }
.destination-tile--theme-lime { --tile-hue: #a7f3d0; --tile-hue-soft: rgba(74, 222, 128, 0.4); --tile-hue-border: rgba(74, 222, 128, 0.55); --tile-hue-glow: rgba(74, 222, 128, 0.65); --tile-bg-a: rgba(74, 222, 128, 0.26); --tile-bg-b: rgba(52, 211, 153, 0.14); }
.destination-tile--theme-orange { --tile-hue: #fdba74; --tile-hue-soft: rgba(249, 115, 22, 0.4); --tile-hue-border: rgba(249, 115, 22, 0.55); --tile-hue-glow: rgba(249, 115, 22, 0.68); --tile-bg-a: rgba(249, 115, 22, 0.28); --tile-bg-b: rgba(251, 146, 60, 0.14); }
.destination-tile--theme-pink { --tile-hue: #fbcfe8; --tile-hue-soft: rgba(236, 72, 153, 0.4); --tile-hue-border: rgba(236, 72, 153, 0.55); --tile-hue-glow: rgba(236, 72, 153, 0.68); --tile-bg-a: rgba(236, 72, 153, 0.26); --tile-bg-b: rgba(244, 114, 182, 0.14); }
.destination-tile--theme-purple { --tile-hue: #c4b5fd; --tile-hue-soft: rgba(167, 139, 250, 0.28); --tile-hue-border: rgba(167, 139, 250, 0.42); --tile-hue-glow: rgba(167, 139, 250, 0.5); --tile-bg-a: rgba(167, 139, 250, 0.18); --tile-bg-b: rgba(139, 92, 246, 0.08); }
.destination-tile--theme-teal { --tile-hue: #5eead4; --tile-hue-soft: rgba(45, 212, 191, 0.26); --tile-hue-border: rgba(45, 212, 191, 0.4); --tile-hue-glow: rgba(45, 212, 191, 0.48); --tile-bg-a: rgba(45, 212, 191, 0.15); --tile-bg-b: rgba(34, 211, 238, 0.07); }
.destination-tile--theme-fuchsia { --tile-hue: #f0abfc; --tile-hue-soft: rgba(232, 121, 249, 0.28); --tile-hue-border: rgba(232, 121, 249, 0.42); --tile-hue-glow: rgba(232, 121, 249, 0.52); --tile-bg-a: rgba(232, 121, 249, 0.18); --tile-bg-b: rgba(217, 70, 239, 0.08); }
.destination-tile--theme-spotify { --tile-hue: #4ade80; --tile-hue-soft: rgba(29, 185, 84, 0.28); --tile-hue-border: rgba(29, 185, 84, 0.45); --tile-hue-glow: rgba(29, 185, 84, 0.55); --tile-bg-a: rgba(29, 185, 84, 0.18); --tile-bg-b: rgba(74, 222, 128, 0.07); }
.destination-tile--theme-apple { --tile-hue: #fb7185; --tile-hue-soft: rgba(250, 45, 72, 0.26); --tile-hue-border: rgba(250, 45, 72, 0.42); --tile-hue-glow: rgba(250, 45, 72, 0.5); --tile-bg-a: rgba(250, 45, 72, 0.16); --tile-bg-b: rgba(251, 113, 133, 0.08); }
.destination-tile--theme-youtube { --tile-hue: #f87171; --tile-hue-soft: rgba(255, 0, 51, 0.24); --tile-hue-border: rgba(255, 0, 51, 0.4); --tile-hue-glow: rgba(255, 0, 51, 0.48); --tile-bg-a: rgba(255, 0, 51, 0.15); --tile-bg-b: rgba(249, 115, 22, 0.07); }
.destination-tile--theme-deezer { --tile-hue: #c084fc; --tile-hue-soft: rgba(162, 56, 255, 0.26); --tile-hue-border: rgba(162, 56, 255, 0.42); --tile-hue-glow: rgba(162, 56, 255, 0.5); --tile-bg-a: rgba(162, 56, 255, 0.16); --tile-bg-b: rgba(139, 92, 246, 0.08); }
.destination-tile--theme-boomplay { --tile-hue: #7dd3fc; --tile-hue-soft: rgba(56, 189, 248, 0.24); --tile-hue-border: rgba(56, 189, 248, 0.38); --tile-hue-glow: rgba(56, 189, 248, 0.45); --tile-bg-a: rgba(56, 189, 248, 0.14); --tile-bg-b: rgba(34, 211, 238, 0.07); }
.destination-tile--theme-shazam { --tile-hue: #38bdf8; --tile-hue-soft: rgba(14, 165, 233, 0.24); --tile-hue-border: rgba(14, 165, 233, 0.38); --tile-hue-glow: rgba(14, 165, 233, 0.45); --tile-bg-a: rgba(14, 165, 233, 0.14); --tile-bg-b: rgba(34, 211, 238, 0.07); }
.destination-tile--theme-suno { --tile-hue: #e8a878; --tile-hue-soft: rgba(212, 132, 90, 0.26); --tile-hue-border: rgba(212, 132, 90, 0.4); --tile-hue-glow: rgba(212, 132, 90, 0.48); --tile-bg-a: rgba(212, 132, 90, 0.16); --tile-bg-b: rgba(217, 70, 239, 0.07); }
.destination-tile--theme-instagram { --tile-hue: #f472b6; --tile-hue-soft: rgba(228, 64, 95, 0.26); --tile-hue-border: rgba(228, 64, 95, 0.4); --tile-hue-glow: rgba(228, 64, 95, 0.48); --tile-bg-a: rgba(228, 64, 95, 0.15); --tile-bg-b: rgba(236, 72, 153, 0.08); }
.destination-tile--theme-tiktok { --tile-hue: #67e8f9; --tile-hue-soft: rgba(105, 201, 208, 0.26); --tile-hue-border: rgba(105, 201, 208, 0.4); --tile-hue-glow: rgba(105, 201, 208, 0.48); --tile-bg-a: rgba(105, 201, 208, 0.14); --tile-bg-b: rgba(244, 114, 182, 0.07); }
.destination-tile--theme-facebook { --tile-hue: #60a5fa; --tile-hue-soft: rgba(24, 119, 242, 0.24); --tile-hue-border: rgba(24, 119, 242, 0.38); --tile-hue-glow: rgba(24, 119, 242, 0.45); --tile-bg-a: rgba(24, 119, 242, 0.14); --tile-bg-b: rgba(96, 165, 250, 0.07); }
.destination-tile--theme-x { --tile-hue: #e2e8f0; --tile-hue-soft: rgba(231, 233, 234, 0.18); --tile-hue-border: rgba(231, 233, 234, 0.32); --tile-hue-glow: rgba(231, 233, 234, 0.35); --tile-bg-a: rgba(148, 163, 184, 0.12); --tile-bg-b: rgba(100, 116, 139, 0.08); }

.destination-tile--planned .destination-tile__icon-wrap {
  filter: saturate(0.88) brightness(0.96);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767px) {
  :root {
    --home-search-strip-h: 2.7rem;
  }

  .home-shell {
    padding: var(--home-content-top) 0.75rem calc(var(--start-bottom-reserve) + env(safe-area-inset-bottom, 0px));
  }

  .home__header {
    padding: 0.35rem 0.75rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-glow,
  .home-glow::after {
    animation: none;
  }
}

/* Creative Brain insight strip (CB-2) — skjult indtil feature er klar */
.home-brain-insight {
  display: none !important;
  max-width: min(42rem, 92vw);
  margin: 0 auto 0.65rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--cs-accent, #5ec4e8) 35%, transparent);
  background: color-mix(in srgb, var(--cs-surface-elevated, #0f1f33) 88%, transparent);
  text-align: center;
}

.home-brain-insight__label {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
}

.home-brain-insight__text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
}
