@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@500;700;800&family=Golos+Text:wght@400;500;600&display=swap');

:root {
  --bg: #fbf7f2;
  --bg-2: #f5f2ff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-border: rgba(34, 43, 60, 0.1);
  --text: #1b2430;
  --text-soft: #5f6b7c;
  --accent: #f39b4a;
  --accent-2: #f5c089;
  --accent-3: #5c76d8;
  --shadow: 0 18px 40px rgba(28, 36, 52, 0.14);
  --radius-lg: 28px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
}

body {
  font-family: 'Golos Text', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% -10%, #ffe8c1 0%, transparent 45%),
    radial-gradient(circle at 110% 10%, #bce9ff 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, #e0dcff 0%, transparent 45%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
  padding: 1.2rem 1.2rem calc(6rem + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
}

.bg-texture {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  width: 200px;
  height: 200px;
  top: -60px;
  right: -40px;
  background: rgba(255, 180, 84, 0.5);
}

.orb-b {
  width: 180px;
  height: 180px;
  left: -40px;
  bottom: 15%;
  background: rgba(245, 192, 137, 0.45);
}

.orb-c {
  width: 150px;
  height: 150px;
  right: 28%;
  bottom: -60px;
  background: rgba(106, 125, 255, 0.4);
}

.topbar,
.layout,
.dock,
.drawer {
  position: relative;
  z-index: 1;
}

.topbar {
  max-width: 1800px;
  margin: 0 auto 0.8rem;
}

.topbar-inner {
  display: flex;
  justify-content: center;
}

.brand {
  position: relative;
  text-align: center;
}

.brand h1 {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(2.4rem, 4vw, 3.5rem);
  letter-spacing: -0.02em;
}

.brand p {
  margin: 0.35rem 0 0;
  color: var(--text-soft);
  font-size: 1rem;
}

.creator-float {
  position: absolute;
  top: -0.15rem;
  right: -2.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.45rem 0.18rem 0.38rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(34, 43, 60, 0.08);
  box-shadow: 0 2px 8px rgba(28, 36, 52, 0.06);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.creator-float:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(243, 155, 74, 0.2);
}

.creator-float-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7d8796;
}

.creator-float-logo {
  height: 13px;
  width: auto;
  object-fit: contain;
}

.layout {
  max-width: 1800px;
  width: 100%;
  margin: 0 auto;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.viewer {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  flex: 1 1 0;
  min-height: 0;
}

.viewer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.spotlight-head {
  display: flex;
  gap: 0.4rem;
}

.badge {
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(243, 155, 74, 0.24);
  color: #8a4a1b;
}

.badge.subtle {
  background: rgba(106, 125, 255, 0.2);
  color: #3943a8;
}

.viewer-url {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.96rem;
  color: #3440c3;
  text-decoration: none;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-url:hover {
  text-decoration: underline;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.85);
  color: #2a3566;
  border: 1px solid rgba(52, 64, 195, 0.2);
}

.frame-shell {
  border: 1px solid rgba(35, 48, 72, 0.12);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fffdfa;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.frame-message {
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid rgba(35, 48, 72, 0.08);
  color: #596377;
  font-size: 0.8rem;
  font-weight: 600;
  background: #fff6e6;
}

.frame-message[data-state='error'] {
  color: #a05238;
  background: #fff0ea;
}

.frame-message[data-state='preview'] {
  color: #8a4a1b;
  background: #fff4e8;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.frame-message[data-state='loading'] {
  background: linear-gradient(90deg, #fff6e6 25%, #ffeed0 50%, #fff6e6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

.frame-viewport {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 220, 170, 0.3), transparent 55%),
    radial-gradient(circle at 75% 70%, rgba(200, 215, 255, 0.3), transparent 50%),
    linear-gradient(160deg, #faf6f0 0%, #f0edf8 100%);
}

.site-frame,
.site-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: none;
  z-index: 1;
}

.site-frame.active,
.site-shot.active {
  display: block;
}

.site-shot {
  object-fit: cover;
  object-position: top center;
  background: #f6f7f9;
  transition: filter 180ms ease, opacity 180ms ease;
}

.frame-viewport.blocked-preview .site-shot {
  filter: brightness(1.14) saturate(1.03);
  opacity: 1;
}

.fallback-card {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 227, 193, 0.55), transparent 60%),
    radial-gradient(circle at 80% 0%, rgba(215, 228, 255, 0.55), transparent 55%),
    linear-gradient(160deg, rgba(250, 246, 240, 0.9) 0%, rgba(247, 240, 229, 0.92) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 2;
}

.fallback-card.active {
  opacity: 1;
  pointer-events: auto;
}

.frame-viewport.blocked-preview .fallback-card {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 227, 193, 0.26), transparent 62%),
    radial-gradient(circle at 80% 0%, rgba(215, 228, 255, 0.24), transparent 58%),
    linear-gradient(160deg, rgba(250, 246, 240, 0.54) 0%, rgba(247, 240, 229, 0.58) 100%);
}

.fallback-inner {
  text-align: center;
  padding: 1.4rem 1.6rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px dashed rgba(90, 49, 18, 0.22);
  box-shadow: 0 18px 32px rgba(35, 40, 58, 0.18);
  max-width: 420px;
  margin: 1rem;
}

.frame-viewport.blocked-preview .fallback-inner {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 24px rgba(35, 40, 58, 0.16);
}

.fallback-eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(90, 49, 18, 0.65);
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.fallback-inner h3 {
  margin: 0 0 0.4rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.2rem;
}

.fallback-inner p {
  margin: 0;
  color: #5f6b7c;
  font-size: 0.95rem;
}

.fallback-open {
  margin-top: 0.95rem;
  background: linear-gradient(120deg, #f39b4a 0%, #f7bf84 100%);
  color: #5a3112;
  border: 1px solid rgba(120, 65, 22, 0.2);
  box-shadow: 0 10px 20px rgba(243, 155, 74, 0.28);
}

.fallback-open:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(243, 155, 74, 0.34);
}

.hints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.82rem;
  color: #6a7386;
}

kbd {
  border: 1px solid rgba(52, 64, 195, 0.2);
  border-bottom-width: 2px;
  border-radius: 8px;
  padding: 0.05rem 0.38rem;
  background: #fff;
  color: #2a3566;
  font-weight: 700;
  margin-right: 0.1rem;
}

.drawer {
  position: fixed;
  top: 1rem;
  bottom: 1rem;
  width: min(380px, 92vw);
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transform: translateX(120%);
  transition: transform 250ms ease, opacity 250ms ease;
  opacity: 0;
  z-index: 5;
}

.drawer.open {
  transform: translateX(0);
  opacity: 1;
}

#filterPanel {
  left: 1rem;
  transform: translateX(-120%);
}

#filterPanel.open {
  transform: translateX(0);
}

#infoPanel {
  right: 1rem;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.drawer h2 {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.4rem;
}

.drawer p {
  margin: 0.35rem 0 0;
  color: var(--text-soft);
}

.icon-btn {
  border: 1px solid rgba(27, 36, 48, 0.16);
  border-radius: 999px;
  background: #fff;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-weight: 700;
}

.filter-actions {
  display: flex;
  gap: 0.4rem;
}

.chip-action {
  border: 1px solid rgba(27, 36, 48, 0.12);
  background: #fff;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  overflow: auto;
  padding-right: 0.2rem;
  padding-bottom: 1rem;
}

.chip {
  border: 1px solid rgba(27, 36, 48, 0.12);
  border-radius: 999px;
  background: #f5f6ff;
  color: #2f375f;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

.chip.active {
  color: #201d04;
  background: linear-gradient(120deg, #ffd580 0%, #ffbd59 100%);
  border-color: transparent;
}

.info-meta {
  display: grid;
  gap: 0.6rem;
  border-top: 1px solid rgba(27, 36, 48, 0.1);
  padding-top: 0.8rem;
}

.info-meta div {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.meta-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a8393;
  font-weight: 700;
}

.meta-value {
  font-weight: 700;
}

.site-description {
  color: #4b5668;
  line-height: 1.55;
}

.recent-block h3 {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1rem;
}

.recent-list {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.recent-item {
  border: 1px solid rgba(27, 36, 48, 0.1);
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 0.55rem;
  font-size: 0.85rem;
}

.recent-item a {
  color: #2f3c9c;
  text-decoration: none;
  font-weight: 800;
}

.recent-item a:hover {
  text-decoration: underline;
}

.recent-item .meta {
  margin-top: 0.12rem;
  color: #7d8797;
  font-size: 0.74rem;
}

.dock {
  position: fixed;
  left: 50%;
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 239, 216, 0.5) 45%,
    rgba(218, 230, 255, 0.55) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 22px 40px rgba(45, 62, 104, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
  backdrop-filter: blur(20px) saturate(1.35);
  isolation: isolate;
  overflow: hidden;
  z-index: 6;
}

.dock::before {
  content: '';
  position: absolute;
  inset: -40% 0 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.7), transparent 55%),
    radial-gradient(circle at 85% 10%, rgba(243, 155, 74, 0.45), transparent 55%),
    radial-gradient(circle at 50% 110%, rgba(92, 118, 216, 0.4), transparent 65%);
  opacity: 0.8;
  pointer-events: none;
  z-index: 0;
}

.dock-btn {
  border: 0;
  background: transparent;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #30394a;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
  height: 44px;
  white-space: nowrap;
}

.dock-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 18px rgba(77, 99, 145, 0.18);
  transform: translateY(-1px);
}

.dock-btn:active {
  transform: translateY(1px) scale(0.98);
}

.dock-btn.active {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 20px rgba(58, 77, 117, 0.2);
}

.dock-btn.primary {
  background: linear-gradient(120deg, #f39b4a 0%, #f8c28f 55%, #ffe0b5 120%);
  color: #5a3112;
  box-shadow: 0 10px 22px rgba(243, 155, 74, 0.28);
  padding: 0.4rem 1.4rem;
  min-width: clamp(165px, 22vw, 210px);
}

.dock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(92, 118, 216, 0.16), rgba(243, 155, 74, 0.18));
  color: #3c4aa8;
  font-weight: 800;
}

.dock-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dock-icon img {
  width: 14px;
  height: 14px;
  display: block;
  filter: invert(18%) sepia(10%) saturate(1400%) hue-rotate(204deg) brightness(92%) contrast(92%);
  opacity: 0.85;
}

.dock-btn.primary .dock-icon {
  background: rgba(255, 255, 255, 0.72);
  color: #5a3112;
}

.dock-text {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1;
}

.dock-hint {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(90, 49, 18, 0.75);
  font-weight: 800;
  padding: 0.18rem 0.4rem 0.2rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(90, 49, 18, 0.16);
  box-shadow: 0 6px 12px rgba(54, 48, 40, 0.16);
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 25, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 4;
}

.scrim.active {
  opacity: 1;
  pointer-events: auto;
}

.dock-btn:focus-visible,
.btn:focus-visible,
.chip:focus-visible,
.chip-action:focus-visible,
.icon-btn:focus-visible {
  outline: 2px solid var(--accent-3);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1024px) {
  .viewer-url {
    max-width: 60vw;
  }

  .dock {
    width: min(420px, 92vw);
    justify-content: center;
  }
}

@media (max-width: 800px) {
  .hints {
    display: none;
  }

  .dock-hint {
    display: none;
  }
}

@media (max-width: 768px) {
  .viewer-url {
    max-width: 80vw;
  }

  .creator-float {
    position: static;
    align-self: center;
    margin-top: 0.2rem;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding: 0.6rem 1rem calc(5rem + env(safe-area-inset-bottom, 0px));
  }

  .topbar {
    margin-bottom: 0.4rem;
  }

  .brand h1 {
    font-size: 1.8rem;
  }

  .brand p {
    display: none;
  }

  .viewer-head {
    gap: 0.4rem;
  }

  .dock {
    padding: 0.4rem 0.6rem;
  }

  .dock-btn {
    height: 38px;
  }
}

@media (max-width: 720px) {
  body {
    padding: 1rem 1rem calc(6.5rem + env(safe-area-inset-bottom, 0px));
  }

  .topbar-inner {
    flex-direction: column;
    align-items: center;
  }

  .viewer-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .viewer-actions {
    width: 100%;
    justify-content: space-between;
  }

  .viewer-url {
    max-width: 100%;
  }

  .dock {
    gap: 0.3rem;
    padding: 0.5rem 0.6rem;
  }

  .dock-btn {
    justify-content: center;
    height: 42px;
    padding: 0.4rem 0.7rem;
    font-size: 0.88rem;
  }

  .dock-btn.primary {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0.4rem 1rem;
  }

  .dock-text {
    align-items: center;
  }
}
