:root {
  --text: #121212;
  --muted: rgba(18, 18, 18, 0.6);
  --card-strong: rgba(255, 255, 255, 0.86);
  --card-soft: rgba(255, 255, 255, 0.58);
  --line: rgba(18, 18, 18, 0.08);
  --shadow: 0 24px 60px rgba(38, 24, 15, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(70, 104, 255, 0.92), transparent 24%),
    radial-gradient(circle at 42% 26%, rgba(255, 243, 89, 0.96), transparent 28%),
    radial-gradient(circle at 70% 24%, rgba(255, 138, 52, 0.92), transparent 24%),
    radial-gradient(circle at 92% 18%, rgba(255, 111, 157, 0.78), transparent 18%),
    radial-gradient(circle at 86% 52%, rgba(255, 244, 228, 0.72), transparent 20%),
    linear-gradient(135deg, #d2e6fb 0%, #fff8d2 34%, #ffab52 62%, #ff6d56 82%, #f1ddd3 100%);
  color: var(--text);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
}

button,
input,
select {
  font: inherit;
}

a,
button,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(255, 141, 51, 0.45);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -56px;
  z-index: 20;
  padding: 12px 16px;
  border-radius: 999px;
  background: #121212;
  color: #fff;
  text-decoration: none;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 16px;
}

.page-shell {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  height: 100dvh;
  padding: 12px 0;
}

.hero-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100%;
  height: 100%;
  padding: 10px 0;
}

.hero-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(420px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: rgba(255, 251, 241, 0.88);
  box-shadow: 0 10px 30px rgba(44, 34, 20, 0.08);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #121212;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
}
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.topbar-secondary,
.card-button,
.favorite-button,
.dock-item,
.auth-mode-button,
.auth-send-code,
.auth-submit,
.auth-close {
  border: 0;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.topbar-secondary,
.card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.topbar-secondary {
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(18, 18, 18, 0.08);
}

.card-button.primary {
  background: #121212;
  color: #fff;
}

.card-button.secondary {
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(18, 18, 18, 0.08);
}

.topbar-secondary:hover,
.card-button:hover,
.favorite-button:hover,
.dock-item:hover {
  transform: translateY(-2px);
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 0 0 1px rgba(18, 18, 18, 0.06);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.topbar-user.is-admin {
  cursor: pointer;
}

.topbar-user.is-admin:hover {
  transform: translateY(-2px);
}

.main-shell {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 0;
  padding-top: 12px;
}

.showcase-shell,
.noscript-banner {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.56));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.showcase-shell {
  width: min(1280px, 100%);
  min-height: 0;
  max-height: 100%;
  padding: 16px;
  border-radius: 36px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
}

.nested-shell {
  min-height: 0;
  padding: 8px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.28));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.32),
    inset 0 18px 30px rgba(255, 255, 255, 0.08);
}

.showcase-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  height: auto;
  max-height: min(46vh, 404px);
  padding: 8px;
  overflow-y: auto;
  scroll-snap-type: y proximity;
}

.showcase-track::-webkit-scrollbar,
.dock-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.showcase-track::-webkit-scrollbar-thumb,
.dock-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.14);
}

.showcase-card {
  display: grid;
  gap: 10px;
  min-height: 104px;
  padding: 12px;
  border-radius: 22px;
  background: var(--card-strong);
  box-shadow:
    0 18px 34px rgba(56, 37, 24, 0.06),
    inset 0 0 0 1px rgba(18, 18, 18, 0.06);
  scroll-snap-align: start;
}

.showcase-card.is-favorite {
  box-shadow:
    0 20px 36px rgba(56, 37, 24, 0.08),
    inset 0 0 0 1px rgba(255, 154, 74, 0.28);
}

.showcase-card.is-draggable {
  cursor: grab;
}

.showcase-card.is-dragging {
  opacity: 0.48;
  transform: scale(0.98);
}

.showcase-card.drag-over {
  transform: translateY(-4px);
  box-shadow:
    0 24px 42px rgba(56, 37, 24, 0.12),
    inset 0 0 0 2px rgba(255, 141, 51, 0.38);
}

.showcase-card.active {
  transform: translateX(3px);
  box-shadow:
    0 24px 42px rgba(56, 37, 24, 0.1),
    inset 0 0 0 1px rgba(18, 18, 18, 0.08);
}

.showcase-card.active.drag-over {
  transform: translateY(-4px);
  box-shadow:
    0 24px 42px rgba(56, 37, 24, 0.12),
    inset 0 0 0 2px rgba(255, 141, 51, 0.38);
}

.showcase-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.showcase-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.showcase-identity > div {
  min-width: 0;
}

.showcase-name {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.08;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.showcase-logo,
.dock-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 244, 248, 0.88));
  box-shadow:
    0 10px 22px rgba(54, 38, 28, 0.08),
    inset 0 0 0 1px rgba(18, 18, 18, 0.08);
  overflow: hidden;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.dock-icon {
  width: 56px;
  height: 56px;
  border-radius: 20px;
}

.showcase-logo.is-fallback,
.dock-icon.is-fallback {
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.92), rgba(18, 18, 18, 0.74));
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.showcase-logo.is-brand-surface,
.dock-icon.is-brand-surface {
  background: var(--logo-bg);
}

.showcase-logo.is-artwork,
.dock-icon.is-artwork {
  background: transparent;
  box-shadow: none;
}

.logo-image {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: var(--logo-filter, none);
}

.dock-icon .logo-image {
  width: 38px;
  height: 38px;
}

.showcase-logo.is-artwork .logo-image,
.dock-icon.is-artwork .logo-image {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  filter: none;
}

.favorite-button {
  min-width: 36px;
  min-height: 36px;
  border-radius: 14px;
  background: rgba(247, 247, 247, 0.96);
  box-shadow: inset 0 0 0 1px rgba(18, 18, 18, 0.08);
}

.favorite-button.active {
  background: #121212;
  color: #fff;
}

.tool-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.dock-section {
  margin-top: 0;
  display: flex;
  justify-content: center;
}

.dock-surface {
  width: fit-content;
  max-width: min(100%, 1040px);
  padding: 14px 16px 12px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(255, 248, 238, 0.24)),
    linear-gradient(135deg, rgba(255, 240, 196, 0.14), rgba(255, 168, 126, 0.12));
  backdrop-filter: blur(18px);
  box-shadow:
    0 18px 40px rgba(54, 38, 28, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.dock-list {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  overflow-x: auto;
  max-width: min(100vw - 96px, 1000px);
  padding: 20px 6px 10px;
}

.dock-list.is-empty {
  align-items: center;
  min-height: 88px;
}

.dock-empty {
  margin: 0;
  color: rgba(18, 18, 18, 0.54);
  font-size: 0.92rem;
  font-weight: 500;
}

.dock-item {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 64px;
  height: 88px;
  padding: 0 0 10px;
  background: transparent;
}

.dock-item.is-dragging {
  opacity: 0.42;
}

.dock-item.drag-over .dock-icon {
  transform: translateY(-8px) scale(1.12);
  box-shadow:
    0 20px 38px rgba(50, 37, 28, 0.14),
    inset 0 0 0 2px rgba(255, 141, 51, 0.32);
}

.dock-item:hover .dock-icon,
.dock-item:focus-visible .dock-icon {
  transform: translateY(-7px) scale(1.1);
  box-shadow:
    0 18px 36px rgba(50, 37, 28, 0.12),
    inset 0 0 0 1px rgba(18, 18, 18, 0.08);
}

.dock-item.active .dock-icon {
  transform: translateY(-4px) scale(1.05);
  box-shadow:
    0 18px 36px rgba(50, 37, 28, 0.12),
    inset 0 0 0 1px rgba(18, 18, 18, 0.08);
}

.dock-item.active.drag-over .dock-icon {
  transform: translateY(-8px) scale(1.12);
  box-shadow:
    0 20px 38px rgba(50, 37, 28, 0.14),
    inset 0 0 0 2px rgba(255, 141, 51, 0.32);
}

.nested-shell.drag-over,
.dock-list.drag-over {
  box-shadow: inset 0 0 0 2px rgba(255, 141, 51, 0.22);
}

.dock-item::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #121212;
  opacity: 0;
  transform: translateX(-50%) scale(0.65);
  transition: transform 160ms ease, opacity 160ms ease;
}

.dock-item.active::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.dock-tooltip {
  position: absolute;
  top: 2px;
  left: 50%;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.9);
  box-shadow: 0 10px 24px rgba(28, 20, 15, 0.12);
  color: #fff;
  font-size: 0.74rem;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px) scale(0.96);
  transition: opacity 160ms ease, transform 160ms ease;
}

.dock-item:hover .dock-tooltip,
.dock-item:focus-visible .dock-tooltip {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.noscript-banner {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto 24px;
  padding: 14px 16px;
  border-radius: 20px;
}

.card-button {
  min-width: 38px;
  min-height: 38px;
  width: 38px;
  padding: 0;
}

.card-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.auth-modal-open {
  overflow: hidden;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 18, 0.34);
  backdrop-filter: blur(12px);
}

.auth-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  padding: 26px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72));
  box-shadow:
    0 30px 80px rgba(38, 24, 15, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(24px);
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 0 0 1px rgba(18, 18, 18, 0.08);
  font-size: 1.35rem;
  line-height: 1;
}

.auth-eyebrow {
  margin: 0 0 10px;
  color: rgba(18, 18, 18, 0.48);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.auth-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.auth-description {
  margin: 12px 0 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.auth-mode-switch {
  display: inline-flex;
  gap: 8px;
  margin-top: 22px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(18, 18, 18, 0.06);
}

.auth-mode-button {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: transparent;
  color: rgba(18, 18, 18, 0.64);
  font-weight: 700;
}

.auth-mode-button.active {
  background: #121212;
  color: #fff;
  box-shadow: 0 10px 20px rgba(18, 18, 18, 0.12);
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.auth-field-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field span {
  color: rgba(18, 18, 18, 0.7);
  font-size: 0.88rem;
  font-weight: 600;
}

.auth-input {
  width: 100%;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid rgba(18, 18, 18, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.auth-input::placeholder {
  color: rgba(18, 18, 18, 0.42);
}

.auth-send-code {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(18, 18, 18, 0.08);
  font-weight: 700;
}

.auth-submit {
  min-height: 50px;
  margin-top: 6px;
  border-radius: 18px;
  background: #121212;
  color: #fff;
  font-weight: 700;
}

.auth-send-code:disabled,
.auth-submit:disabled,
.topbar-secondary:disabled {
  cursor: default;
  opacity: 0.58;
  transform: none;
}

.auth-notice,
.auth-error {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.auth-notice {
  color: #0f8d5f;
}

.auth-error {
  color: #b42318;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 20px, 1440px);
    height: 100dvh;
    padding: 10px 0;
  }

  .hero-stage {
    min-height: 100%;
    height: 100%;
    padding: 8px 0;
  }

  .topbar {
    width: min(100%, 420px);
    gap: 10px;
  }

  .topbar-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .card-button {
    width: 100%;
  }

  .showcase-shell {
    max-height: 100%;
    padding: 12px;
    border-radius: 28px;
  }

  .showcase-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(42vh, 360px);
  }

  .tool-actions {
    flex-direction: row;
  }

  .dock-list {
    justify-content: flex-start;
  }

  .auth-panel {
    padding: 22px 18px;
    border-radius: 28px;
  }

  .auth-field-group {
    grid-template-columns: 1fr;
  }

  .auth-send-code,
  .auth-submit {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .showcase-track {
    grid-template-columns: 1fr;
    max-height: min(46vh, 380px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
