/* ─── Global Reset ─── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  -webkit-tap-highlight-color: transparent;
}

/* Font, color, and background come from the design system tokens.
   Reset just normalizes layout and sets the hairline scale. */
body {
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: none;
  --hairline: 1px;
}

@media (min-resolution: 2dppx) {
  body {
    --hairline: 0.5px;
  }
}

@media (min-resolution: 3dppx) {
  body {
    --hairline: 0.7px;
  }
}

/* ── Element resets ── */

ol,
ul {
  margin: 0;
  padding: 0;
}

address,
blockquote,
dl,
figure,
form,
ol,
p,
pre,
table,
ul {
  margin-top: 0;
  margin-bottom: 0;
}

button {
  outline: none;
  border: none;
  background: transparent;
}

button,
input,
select,
optgroup,
textarea,
::file-selector-button {
  font: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  letter-spacing: inherit;
  color: inherit;
  border-radius: 0;
  background-color: transparent;
  opacity: 1;
}

input,
select,
textarea {
  background-color: transparent;
  font-size: 12px;
}

input[type="text"],
select {
  border: var(--hairline) solid rgba(255, 255, 255, 0.333);
}

:focus {
  outline: none;
}

:focus-visible {
  outline-width: 0 !important;
}

/* ::selection is owned by the design system. */
/* ─── Hub layer ───
   Aligns dash UI with dublive-design-system.css. Tokens come from the
   design system; this file is layout + component rules only.
*/

:root {
  --hub-bg:             var(--ink-0);
  --hub-surface:        var(--ink-1);
  --hub-surface-hover:  var(--ink-2);
  --hub-surface-sunken: var(--ink-1);
  --hub-border:         var(--ink-3);
  --hub-border-strong:  var(--ink-4);

  --hub-text:        var(--paper-0);
  --hub-text-bright: var(--paper-0);
  --hub-text-muted:  var(--paper-1);
  --hub-text-dim:    var(--paper-2);
  --hub-text-faint:  var(--paper-3);

  --hub-accent:        var(--noise);
  --hub-accent-hover:  var(--noise-hover);
  --hub-accent-soft:   var(--noise-soft);
  --hub-danger:        #f87171;
  --hub-danger-hover:  rgba(248, 113, 113, 0.10);

  --hub-radius:    var(--r-m);
  --hub-radius-sm: var(--r-s);
  --hub-radius-md: var(--r-m);

  --hub-max-width: 1200px;
  --hub-min-control-height: 48px;

  --hub-highlight: color-mix(in srgb, var(--paper-0) 6%, transparent);
}

/* ── Page layout ─────────────────────────────────────
   Edge-to-edge nav + centered content column. */
.hub-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--hub-bg);
  color: var(--hub-text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: var(--feat-tnum);
}

.hub-container {
  width: 100%;
  max-width: var(--hub-max-width);
  margin: 0 auto;
  padding: 48px 32px 80px;
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  flex: 1;
}

/* ── Nav (formerly title row) ── */
.hub-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  border-bottom: 1px solid var(--ink-3);
  position: relative;
  z-index: 10;
}

/* Logo lockup: triangle mark + heavy wordmark */
.hub-title {
  font-weight: 900;
  font-size: inherit;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--paper-0);
  margin: 0;
  padding: 0;
}

/* ── Avatar ── */
.hub-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink-1);
  border: 1px solid var(--ink-4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--paper-0);
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease);
  flex-shrink: 0;
}
.hub-avatar:hover { border-color: var(--paper-2); }
.hub-avatar:active {
  border-color: var(--paper-0);
  background: color-mix(in srgb, var(--paper-0) 12%, transparent);
}

/* ── Primary action ── */
.hub-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  width: 100%;
  padding: var(--s-3) var(--s-5);
  min-height: var(--hub-min-control-height);
  background: var(--noise);
  color: var(--noise-fg);
  border: 1px solid transparent;
  border-radius: var(--hub-radius-md);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease),
    background var(--dur-base) var(--ease);
}
.hub-btn-primary:hover:not(:disabled) { background: var(--noise-hover); }
.hub-btn-primary:active:not(:disabled) { transform: translateY(1px); }
.hub-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Input row ── */
.hub-input-row { display: flex; gap: var(--s-2); }

.hub-input {
  flex: 1;
  min-width: 0;
  padding: var(--s-3) var(--s-4);
  min-height: var(--hub-min-control-height);
  background: var(--ink-0);
  color: var(--hub-text);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius-md);
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: -0.01em;
  outline: none;
  transition: border-color var(--dur-base) var(--ease);
}
.hub-input::placeholder { color: var(--hub-text-dim); }
.hub-input:focus { border-color: var(--noise); }

/* ── Secondary button ── */
.hub-btn-secondary {
  padding: var(--s-3) var(--s-5);
  min-height: var(--hub-min-control-height);
  min-width: 56px;
  background: transparent;
  color: var(--paper-0);
  border: 1px solid var(--ink-4);
  border-radius: var(--hub-radius-md);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  cursor: pointer;
  transition:
    background var(--dur-base) var(--ease),
    border-color var(--dur-base) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.hub-btn-secondary:hover { background: var(--ink-1); border-color: var(--paper-3); }
.hub-btn-secondary:active { transform: translateY(1px); }

.hub-error {
  color: var(--hub-danger);
  font-size: 13px;
  margin-top: calc(-1 * var(--s-2));
}

/* ── Section label ── */
.hub-section-label {
  font-weight: 500;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-2);
  margin-bottom: calc(-1 * var(--s-2));
}

/* ── Card list (rows) ─────────────────────────────────
   Edge-to-edge rows separated by hairlines, no card border. */
.hub-card-list {
  display: flex;
  flex-direction: column;
}

.hub-card {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 16px;
  margin: 0 -16px;
  border-bottom: 1px solid var(--ink-3);
  background: transparent;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
  text-decoration: none;
  color: inherit;
  position: relative;
}
.hub-card:hover { background: var(--ink-1); }
.hub-card:last-child { border-bottom: none; }

.hub-thumb {
  width: 160px;
  aspect-ratio: 4 / 3;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--ink-3);
  background-color: var(--ink-1);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  overflow: hidden;
}
.hub-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hub-text-faint);
  font-size: 11px;
}

.hub-card-info { min-width: 0; }
.hub-card-title-row {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  min-width: 0;
}
.hub-card-title {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.015em;
  color: var(--hub-text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.hub-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.hub-card-meta-text,
.hub-card-meta-dim,
.hub-card-meta-highlight {
  font-weight: 400;
  font-size: 12px;
  font-feature-settings: var(--feat-tnum);
}
.hub-card-meta-text      { color: var(--paper-2); }
.hub-card-meta-dim       { color: var(--paper-3); }
.hub-card-meta-highlight { color: var(--paper-0); font-weight: 500; }

/* "Remix" pill + source */
.hub-card-remix-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--noise);
  padding: 2px 6px;
  border: 1px solid var(--noise);
  border-radius: 3px;
}
.hub-card-remix {
  font-size: 12px;
  color: var(--paper-0);
  font-weight: 500;
  font-feature-settings: var(--feat-tnum);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hub-card-meta-dot { color: var(--paper-3); }

/* Source attribution: "Forked from <canvas>" / "Redubbed from <canvas>" */
.hub-card-source {
  margin-top: 2px;
  font-size: 12px;
  color: var(--paper-3);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hub-card-source-link {
  color: var(--paper-1);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.hub-card-source-link:hover { color: var(--noise); }

/* ── Icon button ── */
.hub-icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--paper-2);
  cursor: pointer;
  border-radius: 50%;
  transition:
    color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease),
    opacity var(--dur-fast) var(--ease);
  line-height: 1;
  padding: 0;
  min-height: 0;
  min-width: 0;
}
.hub-icon-btn:hover { color: var(--paper-0); background: var(--ink-1); }
.hub-icon-btn:active { color: var(--paper-0); background: var(--ink-2); }
.hub-icon-btn.active { color: var(--paper-0); background: var(--ink-1); }

/* Settings cog inside a row — smaller, fades in on hover */
.hub-card-action {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--paper-2);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.hub-card-action:hover { color: var(--paper-0); background: var(--ink-2); }
.hub-card-action svg { width: 16px; height: 16px; }

@media (hover: hover) {
  .hub-card-actions { opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
  .hub-card:hover .hub-card-actions,
  .hub-card-actions:focus-within { opacity: 1; }

  .hub-icon-btn--auto-hide { opacity: 0; }
  .hub-card:hover .hub-icon-btn--auto-hide,
  .hub-icon-btn--auto-hide:focus-visible,
  .hub-icon-btn--auto-hide.active { opacity: 1; }
}

/* ── Dropdown ── */
.hub-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 100;
  min-width: 190px;
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: var(--r-m);
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.hub-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-2) var(--s-3);
  min-height: 40px;
  background: none;
  border: none;
  color: var(--paper-1);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  border-radius: var(--r-s);
  transition: background var(--dur-fast) var(--ease);
  text-align: left;
}
.hub-dropdown-item:hover  { background: var(--hub-highlight); }
.hub-dropdown-item:active { background: color-mix(in srgb, var(--paper-0) 15%, transparent); color: var(--paper-0); }
.hub-dropdown-item svg { flex-shrink: 0; color: var(--paper-2); }
.hub-dropdown-item--danger { color: var(--hub-danger); }
.hub-dropdown-item--danger svg { color: var(--hub-danger); }
.hub-dropdown-item--danger:hover  { background: var(--hub-danger-hover); }
.hub-dropdown-item--danger:active { background: rgba(248, 113, 113, 0.30); color: #fca5a5; }

.hub-empty {
  color: var(--hub-text-dim);
  font-size: 14px;
  text-align: center;
  padding: var(--s-6) 0;
}

/* ── Footer ── */
.hub-footer {
  width: 100%;
  max-width: var(--hub-max-width);
  margin: auto auto 0;
  padding: var(--s-7) 32px var(--s-5);
  text-align: center;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-2);
}
.hub-footer span { margin: 0 2px; }
.hub-footer button {
  background: none;
  border: none;
  color: var(--paper-2);
  font-family: var(--font);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: var(--s-1) 2px;
  transition: color var(--dur-base) var(--ease);
  min-height: 0;
  min-width: 0;
}
.hub-footer button:hover { color: var(--noise); }
.hub-footer .hub-sep { color: var(--paper-3); }

/* ── Mobile ── */
@media (max-width: 720px) {
  .hub-title-row { padding: 18px 20px; }
  .hub-container { padding: 32px 20px 64px; }
  .hub-card {
    grid-template-columns: 80px 1fr auto;
    gap: 16px;
    padding: 12px;
    margin: 0 -12px;
  }
  .hub-thumb { width: 80px; }
  .hub-card-title { font-size: 15px; }
  .hub-card-actions { opacity: 1 !important; }
}


	@keyframes svelte-12qhfyh-fade-in {
		from {
			opacity: 0;
		}
	}
	@keyframes svelte-12qhfyh-fade-out {
		to {
			opacity: 0;
		}
	}
	@keyframes svelte-12qhfyh-slide-up-in {
		from {
			opacity: 0;
			transform: translateY(24px);
		}
	}
	@keyframes svelte-12qhfyh-slide-down-out {
		to {
			opacity: 0;
			transform: translateY(-12px);
		}
	}

	/* Root snaps instantly — only named shared elements animate */
	::view-transition-old(root),
	::view-transition-new(root) {
		animation: none;
	}

	/* Orbs layer holds steady between splash ↔ login, fades out slowly otherwise */
	::view-transition-old(page-orbs) {
		animation: 800ms ease-out both svelte-12qhfyh-fade-out;
	}
	::view-transition-new(page-orbs) {
		animation: none;
	}

	/* Shared logo + brand morph between splash ↔ login */
	::view-transition-group(page-logo),
	::view-transition-group(page-brand) {
		animation-duration: 400ms;
		animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
	}

	/* Page content slides */
	::view-transition-old(page-content) {
		animation: 120ms cubic-bezier(0.4, 0, 0.2, 1) both svelte-12qhfyh-slide-down-out;
	}
	::view-transition-new(page-content) {
		animation: 140ms cubic-bezier(0.4, 0, 0.2, 1) both svelte-12qhfyh-slide-up-in;
	}
